import java.util.*;

/**
 * @author LKQ
 * @date 2022/6/7 14:46
 * @description 暴力
 */
public class Solution2 {
    public static void main(String[] args) {

    }
    public int maxChunksToSorted(int[] arr) {
        int ans = 0, max = 0;
        for (int i = 0; i < arr.length; ++i) {
            max = Math.max(max, arr[i]);
            if (max == i) {
                ans++;
            }
        }
        return ans;
    }
}
